package cn.hairui.blog.service;

import cn.hairui.blog.dao.TagMapper;
import cn.hairui.blog.entity.Tag;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 标签表 服务实现类
 * </p>
 *
 * @author laoganbu
 * @since 2020-04-06
 */
@Service(value = "tagService")
public class TagServiceImpl extends ServiceImpl<TagMapper, Tag> implements TagService {

    @Autowired
    private TagMapper tagMapper;

    @Override
    public int count() {
        return tagMapper.count();
    }

    @Override
    public List<Map> selectTags(int count, String showFlag) {
        return tagMapper.selectTags(count, showFlag);
    }

    @Override
    public List<Map> list() {
        return tagMapper.listTop();
    }

    @Override
    public List<Map> selectTagsByShowFlag(String showFlag) {
        return tagMapper.selectTagsByShowFlag(showFlag);
    }
}
